<?php

require_once 'swift/lib/swift_required.php';

$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
  ->setUsername('mr.adrian.pietka@gmail.com')
  ->setPassword('xxxxxx');

$mailer = Swift_Mailer::newInstance($transport);

$message = Swift_Message::newInstance('Wonderful Subject')
  ->setFrom(array('mr.adrian.pietka@gmail.com' => 'MY NAME'))
  ->setTo(array('adrian@pietka.info' => 'YOU'))
  ->setBody('This is the text of the mail send by Swift using SMTP transport.');


if ($mailer->send($message, $failures))

{
  echo "Failures:";
  print_r($failures);
}